<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::group(['middleware' => 'web'], function () {
    Route::group(['namespace' => 'Frontend'], function () {
        require(__DIR__ . '/Frontend/Frontend.php');
    });
});
Route::any('/laravel-u-editor-server/{server?}',function(){
//    abort(500,'无访问权限');
    return redirect()->route('admin.laravel-u-editor-server');
});
Route::any('/admin/laravel-u-editor-server/server/{server?}', '\Stevenyangecho\UEditor\Controller@server')->name('admin.laravel-u-editor-server')->middleware(['auth','uploadfile']);
Route::get('casLogin', 'Frontend\AccessController@casLogin')->name('access.casLogin');
Route::get('/admin/logout', 'Frontend\AccessController@logout')->name('admin.logout');

Route::group(['namespace' => 'Backend', 'prefix' => 'admin'], function () {
    Route::group(['middleware' => 'admin'], function () {
        //管理后台
        require(__DIR__ . '/Backend/Backstage.php');
        //权限管理
        require(__DIR__ . '/Backend/Access.php');
        //漏洞管理
        require(__DIR__ . '/Backend/Flow.php');
        //组织机构管理
        require(__DIR__ . '/Backend/Ogz.php');
        //组织机构管理
        require(__DIR__ . '/Backend/Qyapp.php');
        //日志管理
        require(__DIR__ . '/Backend/Log.php');
        //图表分析
        require(__DIR__ . '/Backend/ChartAnalysis.php');
        //商品管理
        require(__DIR__ . '/Backend/Goods.php');
        //兑换记录
        require(__DIR__ . '/Backend/Order.php');
        //广告管理
        require(__DIR__ . '/Backend/Announce.php');
        //漏洞分发
        require(__DIR__ . '/Backend/Distribute.php');
        //系统配置
        require(__DIR__ . '/Backend/SysConfig.php');
        //项目管理
        require(__DIR__ . '/Backend/ProjectManage.php');
        //知识库
        require(__DIR__ . '/Backend/Knowledge.php');
    });
    Route::group(['namespace' => 'Email'], function () {
        Route::any('email', 'EmailController@sendto')->name('email.send')->middleware('access.routeNeedsPermission:sysconfig-send');
    });

    Route::any('export', 'ExportController@info')->name('admin.vulschart.export')->middleware('access.routeNeedsPermission:chartsanalysis-export');
});



